#include "QT_ProcessBar.h"

QT_ProcessBar::QT_ProcessBar(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::QT_ProcessBarClass())
{
    ui->setupUi(this);
    time = new QTimer(this);
    //connect(time, &QTimer::timeout, this, &QT_ProcessBar::func);
    time->start(100);
}

QT_ProcessBar::~QT_ProcessBar()
{
    delete ui;
}

void QT_ProcessBar::func()
{
    int value = ui->progressBar->value();
    if (value >= 100)
    {
        time->stop();
        return;
    }
    else
    {
        ui->progressBar->setValue(value + 1);
    }
}
